﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>欢喜过新年,拼手气分2亿</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <script src="http://cdn.iyaoread.com/js/jquery-1.8.1.min.js"></script>
    <link rel="stylesheet" href="css/payment.css"/>
</head>
<body style="background: #f5f5f5">
<div class="table">
    <div class="thead">
       <ul>
           <li >昵称</li>
           <li>支付金额</li>
           <li>支付时间</li>
           <li>获得佣金</li>
       </ul>
    </div>
    <div class="tbody" id="tbody">
    </div>
</div>
<footer>
    <a href="index.html"><img src="http://yuedupic.iyaoread.com/hongbao/qiangUn.png" alt=""/></a>
    <a href="grabMoney.html"><img src="http://yuedupic.iyaoread.com/hongbao/payUn.png" alt=""/></a>
    <a><img src="http://yuedupic.iyaoread.com/hongbao/yonhjOn.png" alt=""/></a>
    <a href="agent.html"><img src="http://yuedupic.iyaoread.com/hongbao/dailiUn.png" alt=""/></a>
    <a href="service.html"><img src="http://yuedupic.iyaoread.com/hongbao/kefuUn.png" alt=""/></a>
</footer>
<script src="js/properties.js"></script>
<script>
$(document).ready(function(){
	$.ajax({
        type: 'GET',
        url: "/activity/commission",
        dataType:"json",
        success:function(data){
          if(data.code==0){
        	  var arrya=data.data;
        	  var s = "";
        	  for(var i = 0;i<arrya.length;i++){
        		   var objc = arrya[i];
        		   s += '<ul><li class="name">'+objc.nickName+'</li><li>'+toDecimal(objc.payAmount/100.0)+'元</li><li class="time"><p>'+objc.payTime+'</p></li><li class="profit">'+toDecimal(objc.amount/100.0)+'元</li></ul>';
              }
        	  $(".tbody").html(s)
          }else if(data.code==99){
        	  window.location = baseUrl+"activity/homePage/Commission";
          }else{
        	  alert(data.data);
          }
        },
        error:function(data){
            alert("请求失败！");
        }
    });
});
function toDecimal(x) { 
    var f = parseFloat(x); 
    if (isNaN(f)) { 
      return; 
    } 
    f = Math.round(x*100)/100; 
    return f; 
}
</script>
</body>
</html>